package com.gitee.gphomework.pattern.commandpattern.command;

import com.gitee.gphomework.pattern.commandpattern.receiver.FtpCmdReceiver;

import java.util.Objects;

/**
 * Created on 2020/3/17
 * Title: 切换到被动模式命令
 * Description: 让服务器在数据端口监听，进入被动模式。
 * Copyright: Copyright(c) 2020
 * Company:
 *
 * @author yifeng
 */
public class PasvCommand implements IFtpCommand {

    private FtpCmdReceiver ftpCmdReceiver;

    public PasvCommand(FtpCmdReceiver ftpCmdReceiver) {
        Objects.requireNonNull(ftpCmdReceiver);
        this.ftpCmdReceiver = ftpCmdReceiver;
    }

    @Override
    public void execute() {
        ftpCmdReceiver.pasv();
    }
}
